package com.cooper.moviedb.bo;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Timestamp;

/**
 * Created with IntelliJ IDEA.
 * User: cooperlee
 * Date: 11/19/12
 * Time: 12:29 PM
 */
@javax.persistence.Table(name = "MEDIA_RELEASE", schema = "", catalog = "media_service_db")
@Entity
public class MediaReleaseEntity {
    private int id;

    @javax.persistence.Column(name = "ID", nullable = false, insertable = true, updatable = true, length = 10, precision = 0)
    @Id
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    private Timestamp joinTime;

    @javax.persistence.Column(name = "JOIN_TIME", nullable = true, insertable = true, updatable = true, length = 19, precision = 0)
    @Basic
    public Timestamp getJoinTime() {
        return joinTime;
    }

    public void setJoinTime(Timestamp joinTime) {
        this.joinTime = joinTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MediaReleaseEntity that = (MediaReleaseEntity) o;

        if (id != that.id) return false;
        if (joinTime != null ? !joinTime.equals(that.joinTime) : that.joinTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (joinTime != null ? joinTime.hashCode() : 0);
        return result;
    }
}
